<div class="showrrboxtext">
    <div class="table-box tablenes business_1">
        <div class="title">项目收支差</div>
        <div class="tuo"><div class="tit">项目收支差(元)</div><div class="con" id="business_1_balancefee">0</div></div>
    </div>
    <div class="table-box tablenes business_2 layui-hide">
        <div class="title">项目资金余额</div>
        <div class="tuo"><div class="tit">项目资金余额</div><div class="con" id="business_2_balancefee">0</div></div>
    </div>
    <div class="table-box tablenes">
        <div class="title">当前收款方-本项目</div>
        <div class="tuo"><div class="tit">已付款金额(元)</div><div class="con" id="right_ben_zhixiang">0</div></div>
        <div class="tuo"><div class="tit">已收票金额(元)</div><div class="con" id="right_ben_piaoshou">0</div></div>
        <div class="tuo"><div class="tit">支出合同金额含变更(元)</div><div class="con" id="right_ben_caimoney">0</div></div>
        <div class="tuo"><div class="tit">支出合同结算金额(元)</div><div class="con" id="right_ben_caijiemoney">0</div></div>
        <div class="tuo"><div class="tit">收票未付款金额(元)</div><div class="con" id="right_ben_shoupiaoweifu">0</div></div>
    </div>
    <div class="table-box tablenes">
        <div class="title">当前收款方-全部项目</div>
        <div class="tuo"><div class="tit">已付款金额(元)</div><div class="con" id="right_quan_zhixiang">0</div></div>
        <div class="tuo"><div class="tit">已收票金额(元)</div><div class="con" id="right_quan_piaoshou">0</div></div>
        <div class="tuo"><div class="tit">支出合同金额含变更(元)</div><div class="con" id="right_quan_caimoney">0</div></div>
        <div class="tuo"><div class="tit">支出合同结算金额(元)</div><div class="con" id="right_quan_caijiemoney">0</div></div>
        <div class="tuo"><div class="tit">收票未付款金额(元)</div><div class="con" id="right_quan_shoupiaoweifu">0</div></div>
    </div>
</div>
<script>
    function set_right_relainfo(enginid=0, duier='') {
        layui.use(['form', 'layer', "laytp",'element','dropdown','laypage','table','soulTable'], function() {
            var laypage = layui.laypage, table = layui.table, dropdown = layui.dropdown, form = layui.form,
                soulTable = layui.soulTable, element = layui.element;

            facade.ajax({url: ask_zhi_xiang_you_show, data: {enginid: enginid, duier: duier}}).done(function (res) {
                if (res.code === 2000) {
                    var data = res.data;
                    var engininfo = res.data.engininfo;
                    if (engininfo) {
                        if (engininfo.business == 1) {
                            $(".business_1").removeClass('layui-hide');
                            $(".business_2").addClass('layui-hide');
                        } else {
                            $(".business_2").removeClass('layui-hide');
                            $(".business_1").addClass('layui-hide');
                        }
                    }


                    if (engininfo) {
                        $("#business_1_balancefee").text(parseFormatNum(engininfo.balancefee));
                        $("#business_2_balancefee").text(parseFormatNum(engininfo.balancefee));
                        if (engininfo.balancefee < 0) {
                            $("#business_2_balancefee").addClass('colorhong');
                        }
                    }
                    $("#right_ben_zhixiang").text(parseFormatNum(data.ben_zhixiang));
                    if (engininfo) {
                        $("#right_ben_zhixiang").text(parseFormatNum(data.ben_zhixiang)).addClass('colorlan').click(function () {
                            openNavPage('查看项目付款信息', 'zhi_xiang/index.php?status=1&enginid=' + engininfo.id + '&duier=' + encodeURIComponent(data.duier));
                        });
                    }
                    $("#right_ben_piaoshou").text(parseFormatNum(data.ben_piaoshou));
                    if (engininfo) {
                        $("#right_ben_piaoshou").text(parseFormatNum(data.ben_piaoshou)).addClass('colorlan').click(function () {
                            openNavPage('查看项目收票明细信息', 'piao_shou/detail.php?status=1&enginid=' + engininfo.id + '&gonger=' + encodeURIComponent(data.duier));
                        });
                    }
                    $("#right_ben_caimoney").text(parseFormatNum(data.ben_caimoney));
                    if (engininfo) {
                        $("#right_ben_caimoney").text(parseFormatNum(data.ben_caimoney)).addClass('colorlan').click(function () {
                            openNavPage('查看支出合同信息', 'contract_cai/index.php?status=1&enginid=' + engininfo.id + '&gonger=' + encodeURIComponent(data.duier));
                        });
                    }
                    $("#right_ben_caijiemoney").text(parseFormatNum(data.ben_caijiemoney)).addClass('colorlan').click(function () {
                        openNavPage('查看支出合同结算信息', 'contract_cai_jie/index.php?status=1&isreal=1&enginid=' + engininfo.id + '&gonger=' + encodeURIComponent(data.duier));
                    });
                    $("#right_ben_shoupiaoweifu").text(parseFormatNum(data.ben_shoupiaoweifu));
                    if (data.ben_shoupiaoweifu < 0) {
                        $("#right_ben_shoupiaoweifu").addClass('colorhong');
                    }
                    $("#right_quan_zhixiang").text(parseFormatNum(data.quan_zhixiang)).addClass('colorlan').click(function () {
                        openNavPage('查看项目付款信息', 'zhi_xiang/index.php?status=1&duier=' + encodeURIComponent(data.duier));
                    });
                    $("#right_quan_piaoshou").text(parseFormatNum(data.quan_piaoshou)).addClass('colorlan').click(function () {
                        openNavPage('查看项目收票明细信息', 'piao_shou/detail.php?status=1&gonger=' + encodeURIComponent(data.duier));
                    });
                    $("#right_quan_caimoney").text(parseFormatNum(data.quan_caimoney)).addClass('colorlan').click(function () {
                        openNavPage('查看支出合同信息', 'contract_cai/index.php?status=1&gonger=' + encodeURIComponent(data.duier));
                    });
                    $("#right_quan_caijiemoney").text(parseFormatNum(data.quan_caijiemoney)).addClass('colorlan').click(function () {
                        openNavPage('查看支出合同结算信息', 'contract_cai_jie/index.php?status=1&isreal=1&gonger=' + encodeURIComponent(data.duier));
                    });
                    $("#right_quan_shoupiaoweifu").text(parseFormatNum(data.quan_shoupiaoweifu));
                    if (data.quan_shoupiaoweifu < 0) {
                        $("#right_quan_shoupiaoweifu").addClass('colorhong');
                    }
                }
            });
        });
    }
</script>